/**
 * 按需加载element-ui
 * 如果需要全部引入，也可以在这里配置
 */

import Vue from 'vue'
import {Message, Notification, Select, Card, Button, MessageBox, Loading} from 'element-ui'

Vue.prototype.$loading = Loading.service
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt
Vue.prototype.$notify = Notification
Vue.prototype.$message = Message

// fix Element Select can not call up keyboard in iOS
Select.computed.readonly = function () {
  const isIE = !this.$isServer && !Number.isNaN(Number(document.documentMode))

  return !(this.filterable || this.multiple || !isIE) && !this.visible
}
Vue.use(Select)
Vue.use(Card)
Vue.use(Button)
